package com.xnyzc.lhy.common.penum.approval;

/**
 * @Description 审批任务表状态
 * @Author zhuyubin
 * @Date 2019/8/12 11:25
 **/
public enum EApprovalTaskStatus {

    pending(0, "待审批"),
    pass(1, "通过"),
    reject(2, "驳回"),
    cancelApply(3, "申请人取消申请");

    private Integer value;

    private String desc;

    EApprovalTaskStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static EApprovalTaskStatus findById(Integer value) {
        EApprovalTaskStatus eApprovalTaskStatus;
        switch (value) {
            case 0:
                eApprovalTaskStatus = EApprovalTaskStatus.pending;
                break;
            case 1:
                eApprovalTaskStatus = EApprovalTaskStatus.pass;
                break;
            case 2:
                eApprovalTaskStatus = EApprovalTaskStatus.reject;
                break;
            case 3:
                eApprovalTaskStatus = EApprovalTaskStatus.cancelApply;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eApprovalTaskStatus;
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
